package ecom.beans;

import ecom.beans.EuroConvertorBean.Currency;
import ecom.beans.exception.CartException;
import ecom.beans.exception.AccountBeanException;
import ecom.beans.exception.DAONotFoundException;
import ecom.beans.exception.DAONotUniqueException;
import ecom.beans.exception.DeviseException;
import ecom.beans.exception.NotAccountAssociatedToUser;
import ecom.beans.exception.NotLoginException;
import ecom.beans.exception.StockQuantityUnavailable;
import ecom.beans.exception.UserBeanException;
import java.util.List;
import java.util.Set;
import javax.ejb.Remote;

@Remote
public interface EcomCustomerRemote {

    void addProductToCart(Long idProduct, Long idProductstore, Integer quantity) throws StockQuantityUnavailable, CartException, NotAccountAssociatedToUser, NotLoginException;

    void removeProductFromCart(Long idProduct, Long idProductstore) throws CartException;

    void updateQuantityProduct(Long prodId, Long storeId, Integer updateQuantity) throws StockQuantityUnavailable, CartException;

    Set<PurchaseBean> getPurchasesInCart();

    void buyCart() throws NotLoginException, NotAccountAssociatedToUser, CartException, AccountBeanException;

    Double getCartTotalPriceInEuro();

    Double getCartTotalPriceInCurrentDevise(String currentCurrency) throws DeviseException;

    CartBean.CartState getCartState();

    List<String> getCurrencySymbols();

    Double convertFromEuro(Double amount, String currentCurrency) throws DeviseException;

    String getCurrencyRealName(String valueOf) throws DeviseException;

    Double convertToEuro(Double amount, String currentCurrency) throws DeviseException;

    void deposit(Double amount) throws NotLoginException, NotAccountAssociatedToUser;

    CartBean getCart();

    void setCart(CartBean cart);

    UserBean getUser();

    void setUser(ecom.beans.UserBean user);

    AccountBean getAccountById(String iban);

    Set<ProductcategoryBean> getAllCategories(String order);

    ProductBean getProductById(Long idProduct) throws DAONotFoundException;

    Set<ProductBean> getProductsByIdProductcategory(Long idProductcategory, String order);

    Set<ProductBean> getProductsByNameOrDesciption(String name, String description, String order);

    Set<ProductBean> getProductsByPriceInterval(Double firstPrice, Double secondPrice, String order);

    Set<ProductBean> getProductsByByMaximumPrice(Double maxPrice, String order);

    ProductstoreBean getProductstoreById(Long idProductstore) throws DAONotFoundException;

    UserBean getUserByPseudoAndPassword(String pseudo, String password) throws DAONotFoundException;

    Currency getCurrencyByName(String name) throws DeviseException;

    Set<ProductBean> getProductsByIdProductstore(Long idProductstore, String order);

    StockBean getStockByIdProductstoreAndIdProduct(Long idProductStore, Long idProduct) throws DAONotFoundException;

    Set<ProductstoreBean> getAllStores(String order);

    Set<StockBean> getBestStocks(String order, Integer limit);

    Set<StockBean> getStockByIdProduct(Long idProduct, String order);

    Set<StockBean> getStockByIdProductcategory(Long idProductcategory, String order);

    Set<StockBean> getStockByIdProductcategoryAndIdProductstore(Long idProductcategory, Long idProductstore, String order);

    Set<StockBean> getStockByIdProductstore(Long idProductstore, String order);

    Set<StockBean> getStocks(String order);

    ProductcategoryBean getProductcategoryById(Long idProductcategory) throws DAONotFoundException;

    Set<StockBean> getStockByProductNameOrDescription(String name, String description, String order);

    Long createUser(String pseudo, String password, String email, String adress, String postalCode, String city, String country, String currency, String tel, boolean isAdmin, String iban, Double balance) throws UserBeanException, DAONotUniqueException, AccountBeanException;

    Set<PurchaseBean> getLastSales(String order);

    void updateUser(String pseudo, String password, String email, String address, String postcode, String city, String country,
            String currency, String telephone);
}
